/*
 * VisitedVertexInfo.cpp
 *
 *  Created on: Sep 27, 2009
 *      Author: jbarreneche
 */

#include "VisitedVertexInfo.h"

VisitedVertexInfo::VisitedVertexInfo(Vertex* vertex, double reachCost,
		VisitedVertexInfo* reachedFrom,
		Edge* reachedThrough)  {
	this->vertex = vertex;
	this->reachCost = reachCost;
	this->reachedFrom = reachedFrom;
	this->reachedThrough = reachedThrough;
}

VisitedVertexInfo::~VisitedVertexInfo() {
}
void VisitedVertexInfo::updateInfo(double newCost, VisitedVertexInfo* reachedFrom,
		Edge* reachedThrough) {

	if (this->reachCost > newCost) {
		this->reachCost = newCost;
		this->reachedFrom = reachedFrom;
		this->reachedThrough = reachedThrough;
	}
}
Vertex* VisitedVertexInfo::getRealVertex() {
	return this->vertex;
}

double VisitedVertexInfo::getReachCost() {
	return this->reachCost;
}

Edge* VisitedVertexInfo::getReachedThrough() {
	return this->reachedThrough;
}

VisitedVertexInfo* VisitedVertexInfo::getReachedFrom() {
	return this->reachedFrom;
}
